package com.googlecode.garbagecan.test.ws;

import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

// http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/
public class MyClient {

	private static final String address = "http://localhost:9000/ws/customerService";

	public static void main(String[] args) throws Exception {
		long start = System.currentTimeMillis();
		URL url = new URL(address + "?wsdl");
		QName qname = new QName("http://ws.test.garbagecan.googlecode.com/", CustomerServiceImpl.class.getSimpleName() + "Service");
		Service service = Service.create(url, qname);
		CustomerService customerService = service.getPort(CustomerService.class);
		System.out.println(customerService.findCustomer("kongxx"));
		long stop = System.currentTimeMillis();
		System.out.println(stop - start);
	}
}
